#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QSerialPort>
#include <QString>
#include <QSerialPortInfo>
#include <QMessageBox>
#include <QTime>
#include <QTimer>
#include <QPainter>
#include <QDebug>

extern "C"{
#include "sku622/sku622.h"
#include "ANR_RS01/anr_rs01.h"
}

QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

    QSerialPort *serialPort;
    uint8_t U8_ReceiveBuff[1024];
    uint16_t U16_ReceiveCnt;
private slots:
    /* 手动连接槽函数 */
    void manual_serialPortReadyRead();
    void timerUpdata();
    /* 自动连接槽函数 */
    void on_CheckSerialBt_clicked();

    void on_OpenSerialBt_clicked();

    void on_CleanBt_clicked();

private:
    Ui::MainWindow *ui;

    long sendNum, recvNum;
    QLabel *lblSendNum;
    QLabel *lblTimer;
    QLabel *lblRecvNum;
    QLabel *lblPortState;
    void setNumOnLabel(QLabel *lbl, QString strS, long num);
    void copyQByteArrayToUint8Array(const QByteArray &byteArray, uint8_t *uint8Array);
    void ShowUWBMeasureData(uint16_t selfId, uint16_t Measure_id, uint32_t dis);
    void ShowTirePressureData(void);

    QTimer *timSend;

};
#endif // MAINWINDOW_H
